package com.nmsl.statistic.service.impl;

import java.util.List;
import com.nmsl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nmsl.statistic.mapper.RetailOrderMapper;
import com.nmsl.statistic.domain.RetailOrder;
import com.nmsl.statistic.service.IRetailOrderService;

/**
 * 零售订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-16
 */
@Service
public class RetailOrderServiceImpl implements IRetailOrderService 
{
    @Autowired
    private RetailOrderMapper retailOrderMapper;

    /**
     * 查询零售订单
     * 
     * @param retailOrderId 零售订单主键
     * @return 零售订单
     */
    @Override
    public RetailOrder selectRetailOrderByRetailOrderId(Long retailOrderId)
    {
        return retailOrderMapper.selectRetailOrderByRetailOrderId(retailOrderId);
    }

    /**
     * 查询零售订单列表
     * 
     * @param retailOrder 零售订单
     * @return 零售订单
     */
    @Override
    public List<RetailOrder> selectRetailOrderList(RetailOrder retailOrder)
    {
        return retailOrderMapper.selectRetailOrderList(retailOrder);
    }

    /**
     * 新增零售订单
     * 
     * @param retailOrder 零售订单
     * @return 结果
     */
    @Override
    public int insertRetailOrder(RetailOrder retailOrder)
    {
        retailOrder.setCreateTime(DateUtils.getNowDate());
        return retailOrderMapper.insertRetailOrder(retailOrder);
    }

    /**
     * 修改零售订单
     * 
     * @param retailOrder 零售订单
     * @return 结果
     */
    @Override
    public int updateRetailOrder(RetailOrder retailOrder)
    {
        return retailOrderMapper.updateRetailOrder(retailOrder);
    }

    /**
     * 批量删除零售订单
     * 
     * @param retailOrderIds 需要删除的零售订单主键
     * @return 结果
     */
    @Override
    public int deleteRetailOrderByRetailOrderIds(Long[] retailOrderIds)
    {
        return retailOrderMapper.deleteRetailOrderByRetailOrderIds(retailOrderIds);
    }

    /**
     * 删除零售订单信息
     * 
     * @param retailOrderId 零售订单主键
     * @return 结果
     */
    @Override
    public int deleteRetailOrderByRetailOrderId(Long retailOrderId)
    {
        return retailOrderMapper.deleteRetailOrderByRetailOrderId(retailOrderId);
    }
}
